#ifndef __TIVOCONNECTION_H__
#define __TIVOCONNECTION_H__

#include <boost/thread.hpp>

#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/write.hpp>

#include <boost/shared_ptr.hpp>

using namespace boost::asio::ip;
namespace MediaCenter
{
    class TiVoConnection
    {
    public:
        TiVoConnection(boost::shared_ptr<boost::asio::io_service> io_service);
        ~TiVoConnection();

        bool IsConnected();
        void SendCommand(const char* const Command);
        void Shutdown();

    private:
        void ConnectionThreadFunc();

        boost::thread* connectionThread;
        bool running;

        boost::shared_ptr<boost::asio::io_service> io_service;
        boost::shared_ptr<tcp::socket> socket;

    };
}
#endif
